<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/cssAndjs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理登陆</title>
 <script language="javascript">
function myReload(){
	document.getElementById("snowCheckCode").src=document.getElementById("snowCheckCode").src+"?nocache="+new Date().getTime();
 }
 function checkCodeFu(){

	 var formValues=$("#form1").serializeArray();
     $.post("${ctx}/user/checkCode",formValues,function(data){
    	 if(data.info=="success"){
    		 login();
             
         }else{
             //保存失败
             $.messager.alert("系统提示","验证码输入有误", "info",function(){
           	  });/* 保存失败 */
           
            
         }
   });
 }
 function login(){
	 document.getElementById('form1').submit();

 } 
</script>
<style type="text/css">
/* .STYLE1 {
	font-size: 11pt;
	font-weight: bold;
} */
</style>
</head>

<body onkeypress="if (event.keyCode == 13) checkCodeFu();" style="background-image:url(${ctx}/css/homeimages/admin_login_bg.gif); margin:0 auto; width:500px;">

<div style="background-image:url(${ctx}/css/homeimages/admin_login.png); width:500px; height:200px; margin-top:130px;">
  <form id="form1" name="form1" method="POST" action="${ctx}/dologin" >
    <table width="500" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="250">&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="40"><div align="right" class="STYLE1">用户名：</div></td>
        <td height="40" colspan="2"><input type="text" name="username" style="height:25px; width:200px; font-size:15pt; font-weight:bold;" /></td>
      </tr>
      <tr>
        <td height="40"><div align="right" class="STYLE1">密&nbsp; 码：</div></td>
        <td height="40" colspan="2"><input type="password" name="password" style="height:25px; width:200px; font-size:15pt; font-weight:bold;" /></td>
      </tr>
      <tr>
        <td height="40"><div align="right" class="STYLE1">验证码：</div></td>
        <td width="100" height="40"><input type="text" name="checkCode" id="checkCode" maxlength="4" title="验证码区分大小写" style="height:25px; width:78px; font-size:15pt; font-weight:bold;" /></td>
        <td width="150" height="40" ><img style="vertical-align:middle" src="SnowCheckCode" name="snowCheckCode" width="80" height="25" border="1" id="snowCheckCode"/><img src="${ctx}/css/easyui/themes/icons/reload.png" name="reload" border="0" style="vertical-align:middle" onClick="myReload()" /></td>
      </tr>
      <tr>
        <td height="40">&nbsp;</td>
        <td height="40" colspan="2">
        <input  type="button"   onclick="checkCodeFu()" value="" style="width:130px; height:30px; background-image:url(${ctx}/css/homeimages/admin_login_button.png); border:0; background-color: transparent; "/>
        </td>
      </tr>
    </table>
  </form>
</div>

</body>
</html>
